<?php
include_once("functions/db_manipulate.php");

if (!init()) {
    redirect("login.php");
    exit();
}

?>
<meta charset="UTF-8">
<?php

$groupsResultSet = getAllGroups();

?>

<div class="userscontent">
    <div class="blockheader">
        Все группы:
    </div>

    <?php
    while ($group = mysql_fetch_assoc($groupsResultSet)) {
        ?>
        <div class="user">
            <div class="usertd">
                <?= $group['id'] ?>
            </div>
            <div class="usertd">
                <?= $group['header'] ?>
            </div>
            <div class="usertd">
                <?= countGroupMembers($group['id']) ?>
            </div>

        </div>
        <div class="blockuserbutton" onclick="location.href='?action=showgrmem&gid=<?= $group['id'] ?>'">
            Участники
        </div>
    <?
    }
    ?>
</div>

